Termination w.r.t. Q of the following Term Rewriting System could be proven:

Q restricted rewrite system:
The TRS R consists of the following rules:

app(app(twice, f), x) → app(f, app(f, x))
app(app(map, f), nil) → nil
app(app(map, f), app(app(cons, h), t)) → app(app(cons, app(f, h)), app(app(map, f), t))
app(app(fmap, nil), x) → nil
app(app(fmap, app(app(cons, f), t_f)), x) → app(app(cons, app(f, x)), app(app(fmap, t_f), x))

Q is empty.


QTRS
  ↳ Overlay + Local Confluence

Q restricted rewrite system:
The TRS R consists of the following rules:

app(app(twice, f), x) → app(f, app(f, x))
app(app(map, f), nil) → nil
app(app(map, f), app(app(cons, h), t)) → app(app(cons, app(f, h)), app(app(map, f), t))
app(app(fmap, nil), x) → nil
app(app(fmap, app(app(cons, f), t_f)), x) → app(app(cons, app(f, x)), app(app(fmap, t_f), x))

Q is empty.

The TRS is overlay and locally confluent. By [19] we can switch to innermost.

↳ QTRS
  ↳ Overlay + Local Confluence
QTRS
      ↳ DependencyPairsProof

Q restricted rewrite system:
The TRS R consists of the following rules:

app(app(twice, f), x) → app(f, app(f, x))
app(app(map, f), nil) → nil
app(app(map, f), app(app(cons, h), t)) → app(app(cons, app(f, h)), app(app(map, f), t))
app(app(fmap, nil), x) → nil
app(app(fmap, app(app(cons, f), t_f)), x) → app(app(cons, app(f, x)), app(app(fmap, t_f), x))

The set Q consists of the following terms:

app(app(twice, x0), x1)
app(app(map, x0), nil)
app(app(map, x0), app(app(cons, x1), x2))
app(app(fmap, nil), x0)
app(app(fmap, app(app(cons, x0), t_f)), x1)


Using Dependency Pairs [1,15] we result in the following initial DP problem:
Q DP problem:
The TRS P consists of the following rules:

APP(app(twice, f), x) → APP(f, app(f, x))
APP(app(fmap, app(app(cons, f), t_f)), x) → APP(app(fmap, t_f), x)
APP(app(twice, f), x) → APP(f, x)
APP(app(fmap, app(app(cons, f), t_f)), x) → APP(app(cons, app(f, x)), app(app(fmap, t_f), x))
APP(app(map, f), app(app(cons, h), t)) → APP(cons, app(f, h))
APP(app(fmap, app(app(cons, f), t_f)), x) → APP(cons, app(f, x))
APP(app(fmap, app(app(cons, f), t_f)), x) → APP(f, x)
APP(app(fmap, app(app(cons, f), t_f)), x) → APP(fmap, t_f)
APP(app(map, f), app(app(cons, h), t)) → APP(f, h)
APP(app(map, f), app(app(cons, h), t)) → APP(app(map, f), t)
APP(app(map, f), app(app(cons, h), t)) → APP(app(cons, app(f, h)), app(app(map, f), t))

The TRS R consists of the following rules:

app(app(twice, f), x) → app(f, app(f, x))
app(app(map, f), nil) → nil
app(app(map, f), app(app(cons, h), t)) → app(app(cons, app(f, h)), app(app(map, f), t))
app(app(fmap, nil), x) → nil
app(app(fmap, app(app(cons, f), t_f)), x) → app(app(cons, app(f, x)), app(app(fmap, t_f), x))

The set Q consists of the following terms:

app(app(twice, x0), x1)
app(app(map, x0), nil)
app(app(map, x0), app(app(cons, x1), x2))
app(app(fmap, nil), x0)
app(app(fmap, app(app(cons, x0), t_f)), x1)

We have to consider all minimal (P,Q,R)-chains.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
QDP
          ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

APP(app(twice, f), x) → APP(f, app(f, x))
APP(app(fmap, app(app(cons, f), t_f)), x) → APP(app(fmap, t_f), x)
APP(app(twice, f), x) → APP(f, x)
APP(app(fmap, app(app(cons, f), t_f)), x) → APP(app(cons, app(f, x)), app(app(fmap, t_f), x))
APP(app(map, f), app(app(cons, h), t)) → APP(cons, app(f, h))
APP(app(fmap, app(app(cons, f), t_f)), x) → APP(cons, app(f, x))
APP(app(fmap, app(app(cons, f), t_f)), x) → APP(f, x)
APP(app(fmap, app(app(cons, f), t_f)), x) → APP(fmap, t_f)
APP(app(map, f), app(app(cons, h), t)) → APP(f, h)
APP(app(map, f), app(app(cons, h), t)) → APP(app(map, f), t)
APP(app(map, f), app(app(cons, h), t)) → APP(app(cons, app(f, h)), app(app(map, f), t))

The TRS R consists of the following rules:

app(app(twice, f), x) → app(f, app(f, x))
app(app(map, f), nil) → nil
app(app(map, f), app(app(cons, h), t)) → app(app(cons, app(f, h)), app(app(map, f), t))
app(app(fmap, nil), x) → nil
app(app(fmap, app(app(cons, f), t_f)), x) → app(app(cons, app(f, x)), app(app(fmap, t_f), x))

The set Q consists of the following terms:

app(app(twice, x0), x1)
app(app(map, x0), nil)
app(app(map, x0), app(app(cons, x1), x2))
app(app(fmap, nil), x0)
app(app(fmap, app(app(cons, x0), t_f)), x1)

We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 6 less nodes.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
QDP
              ↳ QDPSizeChangeProof

Q DP problem:
The TRS P consists of the following rules:

APP(app(twice, f), x) → APP(f, app(f, x))
APP(app(twice, f), x) → APP(f, x)
APP(app(fmap, app(app(cons, f), t_f)), x) → APP(f, x)
APP(app(map, f), app(app(cons, h), t)) → APP(f, h)
APP(app(map, f), app(app(cons, h), t)) → APP(app(map, f), t)

The TRS R consists of the following rules:

app(app(twice, f), x) → app(f, app(f, x))
app(app(map, f), nil) → nil
app(app(map, f), app(app(cons, h), t)) → app(app(cons, app(f, h)), app(app(map, f), t))
app(app(fmap, nil), x) → nil
app(app(fmap, app(app(cons, f), t_f)), x) → app(app(cons, app(f, x)), app(app(fmap, t_f), x))

The set Q consists of the following terms:

app(app(twice, x0), x1)
app(app(map, x0), nil)
app(app(map, x0), app(app(cons, x1), x2))
app(app(fmap, nil), x0)
app(app(fmap, app(app(cons, x0), t_f)), x1)

We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs: